Skip to content

Conversation

@DavidKorczynski
Copy link
Collaborator

We need libunwind-dev libblocksruntime-dev for ubuntu 24 to work with honggfuzz.

We need libunwind-dev libblocksruntime-dev for ubuntu 24 to work with
honggfuzz.

Signed-off-by: David Korczynski <[email protected]>
Copy link
Contributor

@jonathanmetzman jonathanmetzman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

subversion \
zip
zip \
libunwind-dev libblocksruntime-dev # needed for Honggfuzz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand base-builder should already be covered in

PACKAGES=(
libunwind8-dev
libblocksruntime-dev
liblzma-dev
libiberty-dev
zlib1g-dev
pkg-config)
apt-get update && apt-get install -y ${PACKAGES[@]}

but I have to admit I'm not sure what's going on there.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I think we only need this in the base-runner. Will double check in a few hours.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the weirdest part is that libBlocksRuntime pops up on Ubuntu-24.04 only:

root@07ccb8ef8f92:/src/avahi# ldd /out/honggfuzz 
        linux-vdso.so.1 (0x00007fe6f360b000)
        libBlocksRuntime.so.0 => not found
        libunwind-ptrace.so.0 => not found
        libunwind-x86_64.so.8 => not found
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe6f2dea000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fe6f360d000)

With the old images honggfuzz doesn't seem to be linked dynamically against those things:

root@abd8c6c5024a:/src/elfutils# ldd /out/honggfuzz 
        linux-vdso.so.1 (0x00007fe5c0d04000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe5c04b1000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fe5c0ceb000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe5c0ce5000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe5c0cc2000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe5c02bf000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fe5c0d06000)

The only difference seems to be LDFLAGS (with -lBlocksRuntime -lunwind-ptrace -lunwind-generic) passed in

CC=clang CFLAGS="-O3 -funroll-loops -D_HF_LINUX_NO_BFD -Wno-unterminated-string-initialization -Wno-error" make LDFLAGS="-lBlocksRuntime -lunwind-ptrace -lunwind-generic"

Everything else appears to be identical.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like with LDFLAGS removed it isn't linked dynamically against BlocksRuntime. BUILD_OSSFUZZ_STATIC=true also causes Makefile to add

-Wl,-Bstatic \
                            `pkg-config --libs --static libunwind-ptrace libunwind-generic` \
                            -lopcodes -lbfd -liberty -lz \
                            -Wl,-Bdynamic

so it seems to me the issue can be fixed by removing LDFLAGS. I'm not sure why they were added.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out on Ubuntu 24.04 it fails with

ar rcs libhfcommon/libhfcommon.a libhfcommon/files.o libhfcommon/log.o libhfcommon/ns.o libhfcommon/util.o
clang -o honggfuzz cmdline.o display.o fuzz.o honggfuzz.o input.o mangle.o report.o sanitizers.o socketfuzzer.o subproc.o linux/arch.o linux/bfd.o linux/perf.o linux/pt.o linux/trace.o linux/unwind.o libhfcommon/libhfcommon.a -pthread -L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib -lm -L/usr/local/include -Wl,-Bstatic `pkg-config --libs --static libunwind-ptrace libunwind-generic` -lopcodes -lbfd -liberty -lz -Wl,-Bdynamic -lrt -ldl -lm -Wl,-Bstatic -lBlocksRuntime -Wl,-Bdynamic
/usr/bin/ld: /lib/x86_64-linux-gnu/libunwind-ptrace.a(_UPT_access_fpreg.o): relocation R_X86_64_32S against symbol `_UPT_reg_offset' can not be used when making a PIE object; recompile with -fPIE
/usr/bin/ld: failed to set dynamic section sizes: bad value
clang: error: linker command failed with exit code 1 (use -v to see invocation)

so I'm guessing that's where LDFLAGS came from (it's load-bearing apparently :-)). Either way it seems the deps should go to base-runner only.

@DavidKorczynski
Copy link
Collaborator Author

/gcbrun skip

Signed-off-by: David Korczynski <[email protected]>
@DavidKorczynski DavidKorczynski enabled auto-merge (squash) November 26, 2025 00:10
@DavidKorczynski DavidKorczynski merged commit 92ad69d into master Nov 26, 2025
20 checks passed
@DavidKorczynski DavidKorczynski deleted the honggfuzz-upgrade branch November 26, 2025 00:57
AdamKorcz pushed a commit that referenced this pull request Nov 26, 2025
in #13964 `--pull` was added to
`docker build`. However, this causes issues when developing the images
locally, as we always end up pulling upstream images causing issues when
building changes that carry through several base images. Removing
`--pull` from this.

Was running into this when debugging
#14315
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants